<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="js/template-web.js"></script>
    <script id="tdl">
        < div >
            <
            span > 姓名： {
                {
                    name
                }
            } < /span> <
            span > 年龄: {
                {
                    age
                }
            } < /span> <
            /div>
    </script>
    <script>
        var data = {
            name: '李四',
            age: 30
        }

        var html = template('tdl', data);
        console.log(html);
    </script>

</body>

</html>